import Vue from 'vue'
import VueI18n from 'vue-i18n'
import ZH from '@/system/locale/zh-CN'
import EN from '@/system/locale/en-US'
import TW from '@/system/locale/zh-TW'
import KR from '@/system/locale/ko-KR'
import JP from '@/system/locale/ja-JP'

Vue.use(VueI18n)

const deLocale = uni.getStorageSync('locale') || 'zh-CN'

const i18n = new VueI18n({
  locale: deLocale,
  messages: {
    'zh-CN': ZH,
    'en-US': EN,
    'zh-TW': TW,
    'ko-KR': KR,
    'ja-JP': JP
  }
})

export default i18n